import Layout from '@/layout'
export const constantRoutes = [
    {
      path: '/login',
      component: () => import('@/views/login/index'),
      hidden: true
    },
  
    {
      path: '/404',
      component: () => import('@/views/404'),
      hidden: true
    },
  
    {
      path: '/',
      component: Layout,
      redirect: '/home',
      children: [{
        path: 'home',
        name: 'home',
        component: () => import('@/views/home/index'),
        meta: { title: '首页', icon: 'el-icon-s-home' }
      }]
    },
  
    {
      path: '/example',
      component: Layout,
      redirect: '/example/table',
      name: 'Example',
      meta: { title: '权限管理', icon: 'el-icon-setting' },
      children: [
        {
          path: 'table',
          name: 'Table',
          component: () => import('@/views/table/index'),
          meta: { title: '用户管理', icon: 'table' }
        },
        {
          path: 'tree',
          name: 'Tree',
          component: () => import('@/views/tree/index'),
          meta: { title: '角色管理', icon: 'tree' }
        }
      ]
    },
    {
      path: '/product',
      component: Layout,
      redirect: '/product/category',
      name: 'product',
      meta: {
        title: '商品管理',
        icon: 'el-icon-shopping-bag-1'
      },
      children: [
        {
          path: 'category',
          component: () => import('@/views/product/category/index'), // Parent router-view
          name: 'category',
          meta: { title: '分类管理' },
        },
        {
          path: 'trademark',
          component: () => import('@/views/product/trademark/index'),
          name: 'trademark',
          meta: { title: '品牌管理' }
        },
        {
          path: 'attr',
          component: () => import('@/views/product/attr/index'),
          name: 'attr',
          meta: { title: '平台属性管理' }
        },
        {
          path: 'spu',
          component: () => import('@/views/product/spu/index'),
          name: 'spu',
          meta: { title: 'SPU管理' }
        },
        {
          path: 'sku',
          component: () => import('@/views/product/sku/index'),
          name: 'sku',
          meta: { title: 'SKU管理' }
        }
      ]
    },
  
    // 404页面必须放在最后面
    { path: '*', redirect: '/404', hidden: true }
  ]